<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>W3Cschool教程(w3cschool.cn)</title>

</head>
<body>
<table style="width:100%;height: 300px"> 
	<tr>
		<td id="tds" style="width: 50%;height: 20%;background-color: #509DD8;color: #FFFF99;">一区</td>
		<td style="width: 50%;height: 20%;background-color: #509DD8;">一区</td>
	</tr>
	
</table>

<script>
	var touchRecord = {
        'startX': '',
        'startT': '',
        'endX': '',
        'endT': '',
        'changeX': '',
        'changeT': ''
    }
	var tds = document.getElementById("tds"); 
	tds.addEventListener("touchstart",touchstartFn);
	tds.addEventListener("touchend",touchendFn);
	
	
	function touchstartFn(){
			touchRecord.startT = new Date().getTime();
			//alert(i);
			tds.style.color = "red";
	}
	function touchendFn(){
			touchRecord.endT = new Date().getTime();
			touchRecord.changeT = touchRecord.endT-touchRecord.startT;
			if(touchRecord.changeT<100){
				open();
			}
			tds.style.color = "blue";
		}
	function open(){
		alert("sdsad");
	}
</script>
	


</body>
</html>